# This file is part of BlackArch Linux ( https://blackarch.org )
# See COPYING for license details.

pkgbase=python-flask-negotiation
pkgname=('python2-flask-negotiation' 'python-flask-negotiation')
_pkgname=Flask-Negotiation
pkgver=0.1.9
pkgrel=7
pkgdesc='Better content negotiation for flask.'
arch=('any')
url='https://pypi.org/project/Flask-negotiation/#files'
makedepends=('python2-setuptools' 'python-setuptools')
license=('custom:unknown')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c3500c940c3734286b6d02bcae54175e7623b6974f4fe5ee3e1c113d5c6242d26325e532c0f34434e27e271142f9d0fbba4573621ee6f87b19e66385a88c10ec')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-flask-negotiation() {
  depends=('python2' 'python2-flask')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-flask-negotiation() {
  depends=('python' 'python-flask')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

